package com.cham.video.mapper;

import com.cham.video.entity.ChamVideoFenzu;
import com.sun.org.glassfish.gmbal.ParameterNames;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Howl-Xu
 * @version 1.0.0
 * @Description: 请描述一下这个类文件吧
 * @createTime 2020年03月26日 16:17:00
 */
public interface VideoFenzuMapper {

    @Select("select * from cham_video_fenzu cvf where cvf.fenzu_status = 'A' and cvf.fenqu_type = 1")
    List<ChamVideoFenzu> getXinfanFenzu();

    @Select("select * from cham_video_fenzu cvf where cvf.fenzu_status = 'A' and cvf.fenqu_type = 2 and cvf.user_uuid = #{userUUID}")
    List<ChamVideoFenzu> getFenzuInfoByUUID(String userUUID);

    @Insert("insert into cham_video_fenzu(fenzu_name,fenzu_status,fenqu_type,user_uuid) VALUES (#{newFenzuName},'A',2,#{userUUID})")
    void addNewNormalFenzu(@Param("newFenzuName") String newFenzuName, @Param("userUUID") String userUUID);

    @Insert("insert into cham_video_fenzu(fenzu_name,fenzu_status,fenqu_type) VALUES (#{newFenzuName},'A',1)")
    void addNewXinfanFenzu(String newFenzuName);
}
